import { VisualEditorPropsType } from '@/visitual-editor/props.util.lowcode'

const typeOptions = [
  {
    label: 'primary',
    value: 'primary'
  },
  {
    label: 'success',
    value: 'success'
  },
  {
    label: 'warning',
    value: 'warning'
  },
  {
    label: 'danger',
    value: 'danger'
  }
]
const actionTypeOptions = [
  {
    label: '弹框',
    value: 'dialog'
  },
  {
    label: '链接',
    value: 'link'
  },
  {
    label: '删除',
    value: 'delete'
  },
  {
    label: '提交',
    value: 'submit'
  },
  {
    label: '取消',
    value: 'cancel'
  },
  {
    label: '返回',
    value: 'back'
  },
  {
    label: '确认',
    value: 'confirm'
  },
  {
    label: '下载',
    value: 'download'
  },
  {
    label: '请求',
    value: 'ajax'
  },
  {
    label: '校验',
    value: 'validate'
  }
]

export const buttonProps = {
  level: {
    type: VisualEditorPropsType.select,
    label: '类型',
    defaultValue: 'primary',
    options: typeOptions
  },
  actionType: {
    type: VisualEditorPropsType.select,
    label: '动作行为',
    options: actionTypeOptions
  },
  body: {
    type: VisualEditorPropsType.input,
    label: '文本'
  },
  plain: {
    type: VisualEditorPropsType.switch,
    label: '是否为朴素按钮',
    defaultValue: false
  },
  text: {
    type: VisualEditorPropsType.switch,
    label: '是否为文字按钮',
    defaultValue: false
  },
  bg: {
    type: VisualEditorPropsType.switch,
    label: '显示按钮背景',
    tips: '是否显示文字按钮背景颜色',
    defaultValue: false
  },
  round: {
    type: VisualEditorPropsType.switch,
    label: '是否为圆角按钮',
    defaultValue: false
  },
  circle: {
    type: VisualEditorPropsType.switch,
    label: '是否为圆形按钮',
    defaultValue: false
  },
  autofocus: {
    type: VisualEditorPropsType.switch,
    label: '自动聚焦',
    defaultValue: false
  }
}
